package 机试题16年;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/4/18.
 */
public class 裁剪网格纸1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int[] x = new int[n];
            int[] y = new int[n];
            for (int i = 0; i < n; i++) {
                x[i] = sc.nextInt();
                y[i] = sc.nextInt();
            }
            System.out.println(rectAngle(n, x, y));
        }
        sc.close();
    }

    private static int rectAngle(int n, int[] x, int[] y) {
        int maxX = Integer.MIN_VALUE, maxY = Integer.MIN_VALUE, minX = Integer.MAX_VALUE, minY = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            maxX = Math.max(maxX, x[i]);
            maxY = Math.max(maxY, y[i]);
            minX = Math.min(minX, x[i]);
            minY = Math.min(minY, y[i]);
        }
        int side = Math.max((maxX - minX), (maxY - minY));
        return side * side;
    }

}
